<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>生产跟踪信息管理 - 经理页面</title>
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <!-- Bootstrap -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.2/dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="../css/bootstrap.min.css">
    <link rel="stylesheet" href="../css/bootstrap-table.min.css">
    <link rel="stylesheet" href="../css/style.css">
    <script src="../js/jquery.min.js"></script>
    <script src="../js/bootstrap.min.js"></script>
    <script src="../js/bootstrap-table.min.js"></script>
    <script src="../js/bootstrap-table-zh-CN.min.js"></script>
    <script src="../js/layui.js"></script>
    <script src="../js/moment.min.js"></script>
</head>
<body>
<!-- 顶部 -->
<header class="header">
    <div class="container-fluid">
        <div class="row align-items-center">
            <div class="col-md-2">
                <img src="../img/logo.png" alt="Logo" class="logo">
            </div>
            <div class="col-md-8 text-center">
                <h1>生产计划的下达与审核</h1>
            </div>
            <div class="col-md-2 text-right">
                <span>欢迎，经理 | <a href="#" style="color: #F5F7FA">注销</a></span>
            </div>
        </div>
    </div>
</header>
<!-- 内容区域 -->
<div class="container-fluid content-row">
    <div class="row">
        <!-- 左侧导航栏 -->
        <nav class="col-md-2 sidebar">
            <!-- 使用 id="accordion" 作为一级菜单容器 -->
            <ul class="nav flex-column" id="accordion">
                <!-- 一级菜单: 基本信息管理 -->
                <li class="nav-item">
                    <a class="nav-link" data-toggle="collapse" href="#basicInfoMenu" role="button"
                       aria-expanded="false" aria-controls="basicInfoMenu">
                        基本信息管理
                    </a>
                    <div class="collapse" id="basicInfoMenu" data-parent="#accordion">
                        <ul class="nav flex-column sub-menu">
                            <!-- 二级菜单: 人员信息管理 -->
                            <li class="nav-item">
                                <a class="nav-link" data-toggle="collapse" href="#personnelMenu" role="button"
                                   aria-expanded="false" aria-controls="personnelMenu">
                                    人员信息管理
                                </a>
                                <div class="collapse" id="personnelMenu" data-parent="#basicInfoMenu">
                                    <ul class="nav flex-column sub-sub-menu">
                                        <li class="nav-item"><a class="nav-link" href="index.html">人员基本信息记录</a></li>
                                        <li class="nav-item"><a class="nav-link" href="index.html">人员信息查询与统计</a></li>
                                        <li class="nav-item"><a class="nav-link" href="index.html">人员信息更新与维护</a></li>
                                    </ul>
                                </div>
                            </li>
                            <!-- 二级菜单: 物料基本信息管理 -->
                            <li class="nav-item">
                                <a class="nav-link" data-toggle="collapse" href="#materialInfoMenu" role="button"
                                   aria-expanded="false" aria-controls="materialInfoMenu">
                                    物料基本信息管理
                                </a>
                                <div class="collapse" id="materialInfoMenu" data-parent="#basicInfoMenu">
                                    <ul class="nav flex-column sub-sub-menu">
                                        <li class="nav-item"><a class="nav-link" href="index.html">物料信息详细记录</a></li>
                                        <li class="nav-item"><a class="nav-link" href="index.html">物料信息便捷查询</a></li>
                                        <li class="nav-item"><a class="nav-link" href="index.html">物料信息更新与维护</a></li>
                                    </ul>
                                </div>
                            </li>
                            <!-- 二级菜单: 设备基本信息管理 -->
                            <li class="nav-item">
                                <a class="nav-link" data-toggle="collapse" href="#equipmentInfoMenu" role="button"
                                   aria-expanded="false" aria-controls="equipmentInfoMenu">
                                    设备基本信息管理
                                </a>
                                <div class="collapse" id="equipmentInfoMenu" data-parent="#basicInfoMenu">
                                    <ul class="nav flex-column sub-sub-menu">
                                        <li class="nav-item"><a class="nav-link" href="index.html">设备信息全面记录</a></li>
                                        <li class="nav-item"><a class="nav-link" href="index.html">设备信息查询与分析</a></li>
                                        <li class="nav-item"><a class="nav-link" href="index.html">设备信息更新与维护</a></li>
                                    </ul>
                                </div>
                            </li>
                            <!-- 二级菜单: 产品信息管理 -->
                            <li class="nav-item">
                                <a class="nav-link" data-toggle="collapse" href="#productInfoMenu" role="button"
                                   aria-expanded="false" aria-controls="productInfoMenu">
                                    产品信息管理
                                </a>
                                <div class="collapse" id="productInfoMenu" data-parent="#basicInfoMenu">
                                    <ul class="nav flex-column sub-sub-menu">
                                        <li class="nav-item-forn"><a class="nav-link" href="product_list.html">产品信息列表</a></li>
                                        <li class="nav-item-edit"><a class="nav-link" href="index.html">产品信息编辑</a></li>
                                    </ul>
                                </div>
                            </li>
                            <!-- 二级菜单: 供应商信息管理 -->
                            <li class="nav-item">
                                <a class="nav-link" data-toggle="collapse" href="#providerInfoMenu" role="button"
                                   aria-expanded="false" aria-controls="providerInfoMenu">
                                    供应商信息管理
                                </a>
                                <div class="collapse" id="providerInfoMenu" data-parent="#basicInfoMenu">
                                    <ul class="nav flex-column sub-sub-menu">
                                        <li class="nav-item-forn"><a class="nav-link" href="provider/provider.html">供应商信息列表</a></li>
                                        <li class="nav-item-edit"><a class="nav-link" href="index.html">供应商信息编辑</a></li>
                                    </ul>
                                </div>
                            </li>
                            <!-- 二级菜单: 生产跟踪信息管理 -->
                            <li class="nav-item">
                                <a class="nav-link" data-toggle="collapse" href="#productionTrackingMenu" role="button"
                                   aria-expanded="false" aria-controls="productionTrackingMenu">
                                    生产跟踪信息管理
                                </a>
                                <div class="collapse" id="productionTrackingMenu" data-parent="#basicInfoMenu">
                                    <ul class="nav flex-column sub-sub-menu">
                                        <li class="nav-item-forn"><a class="nav-link active" href="manager_production_tracking_list.html">生产跟踪信息列表</a></li>
                                        <li class="nav-item-edit"><a class="nav-link" href="index.html">生产跟踪信息编辑</a></li>
                                    </ul>
                                </div>
                            </li>
                        </ul>
                    </div>
                </li>
                <!-- 一级菜单: 生产管理 -->
                <li class="nav-item">
                    <a class="nav-link" data-toggle="collapse" href="#productionMenu" role="button"
                       aria-expanded="false" aria-controls="productionMenu">
                        生产管理
                    </a>
                    <div class="collapse" id="productionMenu" data-parent="#accordion">
                        <ul class="nav flex-column sub-menu">
                            <!-- 二级菜单: 物料采购管理 -->
                            <li class="nav-item">
                                <a class="nav-link" data-toggle="collapse" href="#purchaseMenu" role="button"
                                   aria-expanded="false" aria-controls="purchaseMenu">
                                    物料采购管理
                                </a>
                                <div class="collapse" id="purchaseMenu" data-parent="#productionMenu">
                                    <ul class="nav flex-column sub-sub-menu">
                                        <li class="nav-item"><a class="nav-link" href="index.html">采购申请与审批</a></li>
                                        <li class="nav-item"><a class="nav-link" href="index.html">采购订单跟踪与管理</a></li>
                                        <li class="nav-item"><a class="nav-link" href="index.html">供应商管理</a></li>
                                    </ul>
                                </div>
                            </li>
                            <!-- 二级菜单: 物料消耗管理 -->
                            <li class="nav-item">
                                <a class="nav-link" data-toggle="collapse" href="#consumptionMenu" role="button"
                                   aria-expanded="false" aria-controls="consumptionMenu">
                                    物料消耗管理
                                </a>
                                <div class="collapse" id="consumptionMenu" data-parent="#productionMenu">
                                    <ul class="nav flex-column sub-sub-menu">
                                        <li class="nav-item"><a class="nav-link" href="index.html">物料消耗实时记录</a></li>
                                        <li class="nav-item"><a class="nav-link" href="index.html">物料消耗统计与分析</a></li>
                                        <li class="nav-item"><a class="nav-link" href="index.html">物料消耗预警与优化</a></li>
                                    </ul>
                                </div>
                            </li>
                            <!-- 二级菜单: 设备维护管理 -->
                            <li class="nav-item">
                                <a class="nav-link" data-toggle="collapse" href="#maintenanceMenu" role="button"
                                   aria-expanded="false" aria-controls="maintenanceMenu">
                                    设备维护管理
                                </a>
                                <div class="collapse" id="maintenanceMenu" data-parent="#productionMenu">
                                    <ul class="nav flex-column sub-sub-menu">
                                        <li class="nav-item"><a class="nav-link" href="index.html">预防性维护计划制定</a></li>
                                        <li class="nav-item"><a class="nav-link" href="index.html">设备故障报修与处理</a></li>
                                        <li class="nav-item"><a class="nav-link" href="index.html">设备维护记录查询与分析</a></li>
                                    </ul>
                                </div>
                            </li>
                            <!-- 二级菜单: 生产计划管理 -->
                            <li class="nav-item">
                                <a class="nav-link" data-toggle="collapse" href="#planningMenu" role="button"
                                   aria-expanded="false" aria-controls="planningMenu">
                                    生产计划管理
                                </a>
                                <div class="collapse" id="planningMenu" data-parent="#productionMenu">
                                    <ul class="nav flex-column sub-sub-menu">
                                        <li class="nav-item"><a class="nav-link" href="manager_production_tracking_list.html">生产计划的下达与审核</a></li>
                                        <li class="nav-item"><a class="nav-link" href="staff_production_tracking_list.html">生产计划跟踪</a></li>
                                    </ul>
                                </div>
                            </li>
                        </ul>
                    </div>
                </li>
            </ul>
        </nav>
        <!-- 工作区 -->
        <main class="col-md-10 main-content">
            <h1>生产计划的下达与审核</h1>

            <!-- 搜索表单 -->
            <div class="search-form bg-light p-4 rounded shadow-sm mb-1">
                <form class="form-inline">
                    <!-- 第一行 -->
                    <div class="form-row w-100">
                        <div class="form-group col-md-4 mb-1">
                            <label for="pProductName" class="mr-2">产品名称：</label>
                            <input type="text" class="form-control" id="pProductName" name="pProductName" placeholder="产品名称">
                        </div>

                        <div class="form-group col-md-4 mb-1">
                            <label for="pDepartment" class="mr-2">部门：</label>
                            <input type="text" class="form-control" id="pDepartment" name="pDepartment" placeholder="部门名称">
                        </div>

                        <div class="form-group col-md-4 mb-1">
                            <label for="pManagerId" class="mr-2">经理ID：</label>
                            <input type="number" class="form-control" id="pManagerId" name="pManagerId" placeholder="经理ID">
                        </div>
                    </div>

                    <!-- 第二行 -->
                    <div class="form-row w-100 align-items-center">
                        <div class="form-group col-md-4 mb-1">
                            <label for="pAuditStatus" class="mr-2">审核状态：</label>
                            <select class="form-control" id="pAuditStatus" name="pAuditStatus">
                                <option value="">全部</option>
                                <option value="已审核">已审核</option>
                                <option value="未审核">未审核</option>
                            </select>
                        </div>

                        <div class="form-group col-md-4 mb-1">
                            <label for="pBatchNumber" class="mr-2">批次号：</label>
                            <input type="text" class="form-control" id="pBatchNumber" name="pBatchNumber" placeholder="批次号">
                        </div>
                    </div>

                    <!-- 按钮组 -->
                    <div class="form-row w-100 align-items-center">
                        <div class="form-group col-md-12 mb-3 d-flex justify-content-end">
                            <div class="btn-group">
                                <button type="reset" class="btn btn-outline-secondary">重置</button>
                                <button type="button" class="btn btn-primary ml-2" id="btnSearch">搜索</button>
                            </div>
                            <div>
                                <button type="button" class="btn btn-primary ml-2" id="btnAdd">新增生产信息</button>
                            </div>
                        </div>
                    </div>
                </form>
            </div>

            <!-- 数据表格 -->
            <div class="data-table mt-4">
                <div class="table-responsive">
                    <table class="table table-hover table-bordered" id="data-table"></table>
                </div>
            </div>
        </main>
    </div>
</div>

<!-- Edit Modal -->
<div id="editModal" class="modal fade" tabindex="-1" role="dialog">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title pull-left"><b>生产信息</b></h5>
                <div class="pull-right">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
            </div>
            <div class="modal-body">
                <form id="editForm">
                    <input type="hidden" id="id" name="id">
                    <div class="form-row">
                        <div class="form-group col-md-6">
                            <label for="product_name">产品名称</label>
                            <input type="text" class="form-control" id="product_name" name="product_name" placeholder="产品名称" required onchange="getProductIdByProductName()">
                        </div>
                        <div class="form-group col-md-6">
                            <label for="planned_quantity">计划数量</label>
                            <input type="number" class="form-control" id="planned_quantity" name="planned_quantity" placeholder="计划数量" required>
                        </div>
                    </div>

                    <div class="form-row">
                        <div class="form-group col-md-6">
                            <label for="department">部门</label>
                            <input type="text" class="form-control" id="department" name="department" placeholder="部门名称" required>
                        </div>
                        <div class="form-group col-md-6">
                            <label for="manager_id">经理ID</label>
                            <input type="number" class="form-control" id="manager_id" name="manager_id" placeholder="经理ID" required>
                        </div>
                    </div>

                    <div class="form-row">
                        <div class="form-group col-md-6">
                            <label for="completed_quantity">完成数量</label>
                            <input type="number" class="form-control" id="completed_quantity" name="completed_quantity" placeholder="完成数量" required readonly>
                        </div>
                        <div class="form-group col-md-6">
                            <label for="audit_status">审核状态</label>
                            <select class="form-control" id="audit_status" name="audit_status" required>
                                <option value="已审核">已审核</option>
                                <option value="未审核">未审核</option>
                            </select>
                        </div>
                    </div>

                    <div class="form-row">
                        <div class="form-group col-md-6">
                            <label for="plan_id">计划ID</label>
                            <input type="number" class="form-control" id="plan_id" name="plan_id" placeholder="计划ID" required>
                        </div>
                        <div class="form-group col-md-6">
                            <label for="product_id">产品ID</label>
                            <input type="number" class="form-control" id="product_id" name="product_id" placeholder="产品ID" required>
                        </div>
                    </div>

                    <div class="form-row">
                        <div class="form-group col-md-6">
                            <label for="staff_id">员工ID</label>
                            <input type="number" class="form-control" id="staff_id" name="staff_id" placeholder="员工ID" required readonly>
                        </div>
                        <div class="form-group col-md-6">
                            <label for="batch_number">批次号</label>
                            <input type="text" class="form-control" id="batch_number" name="batch_number" placeholder="批次号" required readonly>
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="remarks">备注</label>
                        <textarea class="form-control" id="remarks" name="remarks" rows="3" readonly></textarea>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">取 消</button>
                <button type="button" class="btn btn-primary" id="saveButton">保 存</button>
            </div>
        </div>
    </div>
</div>

<script src="manager_production_tracking_list.js"></script>
</body>
</html>